home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / jazlib.arc / INT24HND.ASM < prev    next >
Assembly Source File  |  1988-12-18  |  1KB  |  46 lines

  1. Comment *
  2. ┌────────────────────────────────────────────────────────────────────────────┐
  3. │ Title   : int24hnd                                 │
  4. │ Purpose : This procedure is an interrupt handler which installed, bypasses │
  5. │        the abort retry ignore messages and returns the error code to    │
  6. │        the msc variable int24error which should be retrieved using      │
  7. │        int24err();                              │
  8. │                                         │
  9. │    Written by Jack Zucker - 75766,1336    301-794-5950             │
  10. └────────────────────────────────────────────────────────────────────────────┘
  11.  *
  12.     assume cs:_text
  13. _text    segment public byte 'code'
  14.     public _int24hnd,_int24error
  15.  
  16. _int24hnd  proc near
  17.                 ; at this point, the first 3 words on the
  18.                 ; stack are:
  19.                 ; IP,CS,Flags as a result of the Failed
  20.                 ; dos call.
  21.  
  22.     add sp,06h;        ; Discard dos stack info
  23.  
  24.     mov cs:error,di        ; save error in code segment
  25.  
  26.     pop ax            ; pop all registers
  27.     pop bx
  28.     pop cx
  29.     pop dx
  30.     pop si
  31.     pop di
  32.     pop bp
  33.     pop ds
  34.     pop es
  35.                 ; Now whats left on the stack is:
  36.                 ; IP,CS,Flags of the guy who called
  37.                 ; the dos interrupt in the first place
  38.                 ; so lets return to him !
  39.  
  40.     iret            ; return to who called the int 21h
  41. _int24error    label far
  42. error    dw    0
  43. _int24hnd  endp
  44. _text    ends
  45. end
  46.